<template>
  <el-container  class="height100    domainMainContent containerHeight">
    <el-main class="el-mainContent  height100 overflowYHidden"   ref="managerMain">
      <div class="application">
        <div class="app_title">应用</div>
        <div class="app_card" v-for="(item,index) in dataList" :key="index" @click="handleClick(item)">
          <div class="app_icon">
            <img :src="item.square_logo_url" />
          </div>
          <div class="app_name">{{item.name}}</div>
        </div>
        <application_detail
          :visible.sync="visible"
          :itemData="itemData"
          v-if="visible"
        ></application_detail>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import application_detail from "@/components/application_management_detail.vue"
export default {
  name:'app_magement',
  components: {
    application_detail
  },
  data () {
    return {
      dataList: [],
      visible: false,
      itemData: {}
    }
  },
  created(){
    this.getWechatAgentsList();
  },
  methods: {
    //获取应用列表
    getWechatAgentsList(){
      this.$api.wechatAgents(this.$route.query.domainid, {
        onSucess: (resp) => {
          let data = resp.data;
          if(data.errcode == 0){
            this.dataList = data.data;
          }
        }
      })
    },
    handleClick(data){
      this.itemData = data;
      this.visible = true;
    }
  },
}
</script>

<style lang='scss' scoped>
</style>
